package com.yanqu.backendweb.bean.enums;

import com.yanqu.road.entity.enums.ConvertibleEnum;

/**
 * @author duli
 * @version 1.0
 * @date 2020/11/6 17:00
 * @Description
 */
public enum DbType implements ConvertibleEnum<Integer> {
    USER(0, "用户数据库"),
    LOG(0, "日志数据库"),
    ;

    private int intValue;

    private String name;

    DbType(int value, String name) {
        intValue = value;
        this.name = name;
    }

    @Override
    public Integer getIntValue() {
        return intValue;
    }

    @Override
    public String getName() {
        return name;
    }

    public static DbType forValue(int value) {
        for (DbType type : DbType.values()) {
            if (type.intValue == value) {
                return type;
            }
        }
        return null;
    }
}
